package cn.cdzdjd.service.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.cdzdjd.dao.AllowURLMapper;
import cn.cdzdjd.entity.AllowUrl;
import cn.cdzdjd.service.AllowURLService;

@Service
public class AllowURLServiceimpl extends ServiceImpl<AllowURLMapper, AllowUrl> implements AllowURLService {
	
	@Transactional(rollbackFor = Exception.class)
	@Override
	public void batchSave(Set<String> set) {
		List<AllowUrl> list = new ArrayList<>();
		set.forEach(url->{
			AllowUrl allowUrl = new AllowUrl();
			allowUrl.setUrl(url);
			list.add(allowUrl);
		});
		this.saveBatch(list);
	}
}
